    {% include variables.md %}
    {% assign navurl = page.url %}
    {% assign selected_url = . %}
    {% assign selected_item = "Kaa releases" %}
    {% for item in site.data.versions %}
        {% assign key = item[0] %}
        {% assign val = item[1] %}
        {% if navurl contains val.url %}
            {% assign selected_url = val.url %}
            {% assign selected_item = val.text %}
            {% if selected_item == latest_version %}
                {% capture selected_item %}{{selected_item}} (latest){% endcapture %}
            {% endif %}
        {% endif %}
    {% endfor %}
    {% assign page.ver = selected_url %}
    <!--{% if site.data.versions[page.dir] %}
        {% assign selected_url  = site.data.versions[page.dir].url %}
        {% assign selected_item = site.data.versions[page.dir].text %}
    {% endif %}-->
    <a href="#" id="selected_version" class="dropdown-toggle" data-toggle="dropdown">{{ selected_item }}<span class="caret"/></a>
    <ul class="dropdown-menu" id="version-select">
    {% for item in include.nav %}
        {% assign key = item[0] %}
        {% assign val = item[1] %}
        {% if navurl contains val.nav %}
        {%else%}
          <li id="li-version-{{val.text}}">
            <a href="{{ site.baseurl }}{{ val.url }}">
              {{ val.text }}{% if val.text == latest_version %} (latest) {% endif %}</a>
          </li>
         {% endif %}
    {% endfor %}
    </ul>